package com.group.itms.routes.data;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable
public class BObjectOption {

	public static final String IS_ACTIVE = "isActive";
	
	public static final String BOBJECT_COLUMN_NAME = "object_id";
	public static final String OPTION_COLUMN_NAME = "option_id";

	@DatabaseField(id = true)
	private int id;

	@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = BOBJECT_COLUMN_NAME)
	private BObject object;
	@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = OPTION_COLUMN_NAME)
	private Option option;
	@DatabaseField
	private String text;
	@DatabaseField(columnName = IS_ACTIVE)
	private boolean isActive;

	public BObjectOption() {

	}

	public BObjectOption(BObject object, Option option) {
		this.object = object;
		this.option = option;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public BObject getObject() {
		return object;
	}

	public void setObject(BObject object) {
		this.object = object;
	}

	public Option getOption() {
		return option;
	}

	public void setOption(Option option) {
		this.option = option;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Override
	public String toString() {
		return text;
	}

	public boolean isActive() {
		return isActive;
	}

	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

}
